package com.jungle.common.config;

import org.hibernate.annotations.Comment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
import org.ssssssss.magicapi.core.config.MagicFunction;
import org.ssssssss.script.annotation.Function;

@Component  //注入到Spring容器中
public class MyCustomFunction implements MagicFunction {

    @Autowired
    ApplicationEventPublisher applicationEventPublisher;

    @Function
    @Comment("推送事件")
    public void publishEvent(Object event) {
        applicationEventPublisher.publishEvent(event);
    }

}
